package org.alanlau.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试
 * @author liukun
 * @version 1.0
 * @date 2020/9/11 14:32
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private DiscoveryClient discoveryClient;

    @GetMapping("/info")
    public Object getInfo(String serviceId) {
        return discoveryClient.getInstances(serviceId);
    }

    @GetMapping("/hello")
    public String sayHello() {
        return "Hello";
    }
}
